package com.hw.job_3;

public class DataPackage extends Package implements DataServerInterface {

    private double traffic; // 上网流量

    public DataPackage(double month_charge, double traffic) {
        super(month_charge);
        setTraffic(traffic);
    }

    @Override
    public void showInfo() {
        System.out.println("上网套餐信息为：" + "上网流量 = " + getTraffic() + ", 每月资费 = " + getMonth_charge());
    }

    @Override
    public void dataServer(double traffic, MobilePhoneCard mpc) {
        System.out.println("这个是上网接口服务, " + "上网流量 = " + traffic);
        mpc.show();
    }

    public double getTraffic() {
        return traffic;
    }

    public void setTraffic(double traffic) {
        this.traffic = traffic;
    }
}
